home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / media / pov / scenes / other / tiles.inc < prev    next >
Encoding:
Text File  |  1994-10-02  |  6.4 KB  |  258 lines

  1. // Textures: Tiles4, Tiles8 and Tiles16.  Each have (texturename)^2
  2. // (solid) color blocks per unit square.
  3. // Uses tiles{} special texture.
  4. //
  5. // Written 24/04/94 by Jussi Kantola (jkantola@paju.oulu.fi)
  6.  
  7. // These are the sixteen colors, just for example.
  8. // The texture looks great with "random" colors too!
  9.  
  10. #declare C1  = color rgb <4/4, 0, 0>    // Tiles4, Tiles8, Tiles16
  11. #declare C2  = color rgb <3/4, 0, 0>    // Tiles4, Tiles8, Tiles16
  12. #declare C3  = color rgb <2/4, 0, 0>    // Tiles4, Tiles8, Tiles16
  13. #declare C4  = color rgb <1/4, 0, 0>    // Tiles4, Tiles8, Tiles16
  14. #declare C5  = color rgb <0, 1/4, 0>    // Tiles8, Tiles16
  15. #declare C6  = color rgb <0, 2/4, 0>    // Tiles8, Tiles16
  16. #declare C7  = color rgb <0, 3/4, 0>    // Tiles8, Tiles16
  17. #declare C8  = color rgb <0, 4/4, 0>    // Tiles8, Tiles16
  18. #declare C9  = color rgb <0, 0, 4/4>    // Tiles16
  19. #declare C10 = color rgb <0, 0, 3/4>    // Tiles16
  20. #declare C11 = color rgb <0, 0, 2/4>    // Tiles16
  21. #declare C12 = color rgb <0, 0, 1/4>    // Tiles16
  22. #declare C13 = color rgb <1/4, 1/4, 0>    // Tiles16
  23. #declare C14 = color rgb <2/4, 2/4, 0>    // Tiles16
  24. #declare C15 = color rgb <3/4, 3/4, 0>    // Tiles16
  25. #declare C16 = color rgb <4/4, 4/4, 0>    // Tiles16
  26.  
  27. /*#declare C1  = color rgb <4/4, 1/4, 1/4>    // Tiles4, Tiles8, Tiles16
  28. #declare C2  = color rgb <4/4, 2/4, 2/4>    // Tiles4, Tiles8, Tiles16
  29. #declare C3  = color rgb <4/4, 3/4, 3/4>    // Tiles4, Tiles8, Tiles16
  30. #declare C4  = color rgb <4/4, 4/4, 4/4>    // Tiles4, Tiles8, Tiles16
  31. #declare C5  = color rgb <1/4, 1/4, 4/4>    // Tiles8, Tiles16
  32. #declare C6  = color rgb <2/4, 2/4, 4/4>    // Tiles8, Tiles16
  33. #declare C7  = color rgb <3/4, 3/4, 4/4>    // Tiles8, Tiles16
  34. #declare C8  = color rgb <4/4, 4/4, 4/4>    // Tiles8, Tiles16
  35. #declare C9  = color rgb <1/4, 4/4, 1/4>    // Tiles16
  36. #declare C10 = color rgb <2/4, 4/4, 2/4>    // Tiles16
  37. #declare C11 = color rgb <3/4, 4/4, 3/4>    // Tiles16
  38. #declare C12 = color rgb <4/4, 4/4, 4/4>    // Tiles16
  39. #declare C13 = color rgb <1/4, 1/4, 1/4>    // Tiles16
  40. #declare C14 = color rgb <2/4, 2/4, 2/4>    // Tiles16
  41. #declare C15 = color rgb <3/4, 3/4, 3/4>    // Tiles16
  42. #declare C16 = color rgb <4/4, 4/4, 4/4>    // Tiles16
  43. */
  44.  
  45. /*#declare C1  = color Red
  46. #declare C2  = color Green
  47. #declare C3  = color Blue
  48. #declare C4  = color Yellow
  49. #declare C5  = color Cyan
  50. #declare C6  = color Pink
  51. #declare C7  = color Orange
  52. #declare C8  = color SkyBlue
  53. #declare C9  = color White
  54. #declare C10 = color Black
  55. #declare C11 = color Tan
  56. #declare C12 = color SeaGreen
  57. #declare C13 = color IndianRed
  58. #declare C14 = color SlateBlue
  59. #declare C15 = color Khaki
  60. #declare C16 = color DarkSlateGrey */
  61.  
  62. // A finish for the tiles; you could use unique finish
  63. // for each of the colors, but I could not ;-)
  64.  
  65. #declare Tfinish = finish
  66.    {
  67.    specular 1.0
  68.    roughness 0.01
  69.    diffuse 0.95
  70.    ambient 0.05
  71.    }
  72.  
  73. // Okay, here comes the first set of the tiles: plain colors.
  74. // No-one says you have to use solid colors for the blocks:
  75. // just replace these with stones, woods, clouds...
  76.  
  77. #declare T1  = texture { pigment { color C1 } finish { Tfinish } }
  78. #declare T2  = texture { pigment { color C2 } finish { Tfinish } }
  79. #declare T3  = texture { pigment { color C3 } finish { Tfinish } }
  80. #declare T4  = texture { pigment { color C4 } finish { Tfinish } }
  81. #declare T5  = texture { pigment { color C5 } finish { Tfinish } }
  82. #declare T6  = texture { pigment { color C6 } finish { Tfinish } }
  83. #declare T7  = texture { pigment { color C7 } finish { Tfinish } }
  84. #declare T8  = texture { pigment { color C8 } finish { Tfinish } }
  85. #declare T9  = texture { pigment { color C9 } finish { Tfinish } }
  86. #declare T10 = texture { pigment { color C10 } finish { Tfinish } }
  87. #declare T11 = texture { pigment { color C11 } finish { Tfinish } } 
  88. #declare T12 = texture { pigment { color C12 } finish { Tfinish } }
  89. #declare T13 = texture { pigment { color C13 } finish { Tfinish } }
  90. #declare T14 = texture { pigment { color C14 } finish { Tfinish } }
  91. #declare T15 = texture { pigment { color C15 } finish { Tfinish } }
  92. #declare T16 = texture { pigment { color C16 } finish { Tfinish } }
  93.  
  94. // Now, the second set; tiles{} inside tiles{}
  95.  
  96. #declare TA = texture
  97.    {
  98.    tiles
  99.       {
  100.       texture
  101.          {
  102.          tiles
  103.             {
  104.             texture { T1 }
  105.          tile2
  106.             texture { T2 }
  107.             }
  108.          scale 1/2   // these are oh so important!
  109.          }
  110.    tile2
  111.       texture
  112.          {
  113.          tiles
  114.             {
  115.             texture { T3 }
  116.          tile2
  117.             texture { T4 }
  118.             }
  119.          scale 1/2
  120.          }
  121.       }
  122.    }
  123.  
  124. #declare TB = texture
  125.    {
  126.    tiles
  127.       {
  128.       texture
  129.          {
  130.          tiles
  131.             {
  132.             texture { T5 }
  133.          tile2
  134.             texture { T6 }
  135.             }
  136.          scale 1/2
  137.          }
  138.    tile2
  139.       texture
  140.          {
  141.          tiles
  142.             {
  143.             texture { T7 }
  144.          tile2
  145.             texture { T8 }
  146.             }
  147.          scale 1/2
  148.          }
  149.       }
  150.    }
  151.  
  152. #declare TC = texture
  153.    {
  154.    tiles
  155.       {
  156.       texture
  157.          {
  158.          tiles
  159.             {
  160.             texture { T9 }
  161.          tile2
  162.             texture { T10 }
  163.             }
  164.          scale 1/2
  165.          }
  166.    tile2
  167.       texture
  168.          {
  169.          tiles
  170.             {
  171.             texture { T11 }
  172.          tile2
  173.             texture { T12 }
  174.             }
  175.          scale 1/2
  176.          }
  177.       }
  178.    }
  179.  
  180. #declare TD = texture
  181.    {
  182.    tiles
  183.       {
  184.       texture
  185.          {
  186.          tiles
  187.             {
  188.             texture { T13 }
  189.          tile2
  190.             texture { T14 }
  191.             }
  192.          scale 1/2
  193.          }
  194.    tile2
  195.       texture
  196.          {
  197.          tiles
  198.             {
  199.             texture { T15 }
  200.          tile2
  201.             texture { T16 }
  202.             }
  203.          scale 1/2
  204.          }
  205.       }
  206.    }
  207.  
  208. // This is the final phase in the construction
  209. // We put TA, TB, TC and TD into tiles{} once
  210. // again and eventually get 4x4, 8x8 and 16x16
  211. // checker...
  212.  
  213. // the colors in effect for this are C1..C4
  214.  
  215. #declare Tiles4 = texture { TA }
  216.  
  217. // for this, C1..C8
  218.  
  219. #declare Tiles8 = texture
  220.    {
  221.    tiles
  222.       {
  223.       texture { TA scale 1/2 }
  224.    tile2
  225.       texture { TB scale 1/2 }
  226.       }
  227.    }
  228.  
  229. // Here, C1..C16
  230.  
  231. #declare Tiles16 = texture
  232.    {
  233.    tiles
  234.       {
  235.       texture
  236.          {
  237.          tiles
  238.             {
  239.             texture { TA scale 1/2 }
  240.          tile2
  241.             texture { TB scale 1/2 }
  242.             }
  243.          scale 1/2
  244.          }
  245.    tile2
  246.       texture
  247.          {
  248.          tiles
  249.             {
  250.             texture { TC scale 1/2 }
  251.          tile2
  252.             texture { TD scale 1/2 }
  253.             }
  254.          scale 1/2
  255.          }
  256.       }
  257.    }
  258.